package com.climber.spb_rabbitmq.spb_delayqueue_ttl.service;

import com.climber.spb_rabbitmq.spb_delayqueue_ttl.config.RabbitMQConfig;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MessageReceiver {
    //
    @RabbitListener(queues = RabbitMQConfig.Y_DEAD_LETTER_Queue)
    public void receiverA(Message message, Channel channel) {
        System.out.println("A receive message:" + new String(message.getBody()));
        System.out.println(new Date().toString());
    }


}


